' This class is "generated" and will be overwritten.
' Your customizations should be made in OwnerRecord.vb

Imports System.Data.SqlTypes
Imports BaseClasses
Imports BaseClasses.Data
Imports BaseClasses.Data.SqlProvider

Namespace Training1.Business

''' <summary>
''' The generated superclass for the <see cref="OwnerRecord"></see> class.
''' </summary>
''' <remarks>
''' This class is not intended to be instantiated directly.  To obtain an instance of this class, 
''' use the methods of the <see cref="OwnerTable"></see> class.
''' </remarks>
''' <seealso cref="OwnerTable"></seealso>
''' <seealso cref="OwnerRecord"></seealso>

<Serializable()> Public Class BaseOwnerRecord
	Inherits PrimaryKeyRecord
	

	Public Shared Shadows ReadOnly TableUtils As OwnerTable = OwnerTable.Instance

	' Constructors
 
	Protected Sub New()
		MyBase.New(TableUtils)
	End Sub

	Protected Sub New(ByVal record As PrimaryKeyRecord)
		MyBase.New(record, TableUtils)
	End Sub







#Region "Convenience methods to get/set values of fields"

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Owner_.Id field.
	''' </summary>
	Public Function GetId0Value() As ColumnValue
		Return Me.GetValue(TableUtils.Id0Column)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Owner_.Id field.
	''' </summary>
	Public Function GetId0FieldValue() As Int32
		Return CType(Me.GetValue(TableUtils.Id0Column).ToInt32(), Int32)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Owner_.OwnerName field.
	''' </summary>
	Public Function GetOwnerNameValue() As ColumnValue
		Return Me.GetValue(TableUtils.OwnerNameColumn)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Owner_.OwnerName field.
	''' </summary>
	Public Function GetOwnerNameFieldValue() As String
		Return CType(Me.GetValue(TableUtils.OwnerNameColumn).ToString(), String)
	End Function

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Owner_.OwnerName field.
	''' </summary>
	Public Sub SetOwnerNameFieldValue(ByVal val As ColumnValue)
		Me.SetValue(val, TableUtils.OwnerNameColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Owner_.OwnerName field.
	''' </summary>
	Public Sub SetOwnerNameFieldValue(ByVal val As String)
		Dim colValue As ColumnValue = New ColumnValue(val)
		Me.SetValue(colValue, TableUtils.OwnerNameColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Owner_.Address field.
	''' </summary>
	Public Function GetAddressValue() As ColumnValue
		Return Me.GetValue(TableUtils.AddressColumn)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Owner_.Address field.
	''' </summary>
	Public Function GetAddressFieldValue() As String
		Return CType(Me.GetValue(TableUtils.AddressColumn).ToString(), String)
	End Function

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Owner_.Address field.
	''' </summary>
	Public Sub SetAddressFieldValue(ByVal val As ColumnValue)
		Me.SetValue(val, TableUtils.AddressColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Owner_.Address field.
	''' </summary>
	Public Sub SetAddressFieldValue(ByVal val As String)
		Dim colValue As ColumnValue = New ColumnValue(val)
		Me.SetValue(colValue, TableUtils.AddressColumn)
	End Sub



#End Region

#Region "Convenience methods to get field names"

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Owner_.Id field.
	''' </summary>
	Public Property Id0() As Int32
		Get 
			Return CType(Me.GetValue(TableUtils.Id0Column).ToInt32(), Int32)
		End Get
		Set (ByVal val As Int32) 
			Dim colValue As ColumnValue = New ColumnValue(val)
			Me.SetValue(colValue, TableUtils.Id0Column)
		End Set
	End Property


	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property Id0Specified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.Id0Column)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property Id0Default() As String
        Get
            Return TableUtils.Id0Column.DefaultValue
        End Get
    End Property

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Owner_.OwnerName field.
	''' </summary>
	Public Property OwnerName() As String
		Get 
			Return CType(Me.GetValue(TableUtils.OwnerNameColumn).ToString(), String)
		End Get
		Set (ByVal Value As String) 
			Me.SetString(value, TableUtils.OwnerNameColumn)
		End Set
	End Property


	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property OwnerNameSpecified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.OwnerNameColumn)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property OwnerNameDefault() As String
        Get
            Return TableUtils.OwnerNameColumn.DefaultValue
        End Get
    End Property

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Owner_.Address field.
	''' </summary>
	Public Property Address() As String
		Get 
			Return CType(Me.GetValue(TableUtils.AddressColumn).ToString(), String)
		End Get
		Set (ByVal Value As String) 
			Me.SetString(value, TableUtils.AddressColumn)
		End Set
	End Property


	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property AddressSpecified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.AddressColumn)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property AddressDefault() As String
        Get
            Return TableUtils.AddressColumn.DefaultValue
        End Get
    End Property



#End Region

End Class
End Namespace
